package com.lcf.system.controller;


import com.lcf.framework.vo.PageVO;
import com.lcf.system.query.ScorePageQuery;
import com.lcf.system.service.UserScoreService;
import com.lcf.system.vo.UserScoreRankVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户积分(UserScore)表控制层
 *
 * @author lcf
 * @since 2025-04-24 21:14:32
 */
@Tag(name = "用户积分")
@RestController
@RequestMapping("userScore")
public class UserScoreController {
    @Resource
    private UserScoreService userScoreService;

    /**
     * 我的积分
     */
    @Operation(summary = "我的积分")
    @GetMapping
    public Integer myScore() {
        return userScoreService.myScore();
    }

    /**
     * 积分排名
     */
    @Operation(summary = "积分排名")
    @GetMapping("rank")
    public PageVO<UserScoreRankVO> rank(ScorePageQuery query) {
        return userScoreService.rank(query);
    }
}

